<template>
  <view class="container">
    <uv-parse :content="richTxt"></uv-parse>
  </view>
</template>

<script>
  import reqApi from "../../api/api.js";
  export default {
    data() {
      return {
        // titleEnum: {
        //   3: "隐私协议",
        //   4: "用户协议",
        //   7: "关于我们"
        // },
        richTxt: ""
      }
    },
    onLoad(option) {
      console.log("type", option.type);
      // uni.setNavigationBarTitle({
      //   title: this.titleEnum[option.type]
      // });
      this.getData(option.type)
    },
    methods: {
      getData(type){
        reqApi.agreement({type}).then(res=>{
          console.log("协议", res);
          this.richTxt = res.data.content;
          uni.setNavigationBarTitle({
            title: res.data.title
          });
        })
      }
    }
  }
</script>

<style lang="scss" scoped>
  .container {
    padding: 30rpx;
    box-sizing: border-box;
    width: 100vw;
    min-height: calc( 100vh - 88rpx );
    background: #fff;
  }
</style>